<?php
namespace app\controller;

use app\BaseController;
use think\facade\Db;

use app\model\Demo;

class Data extends BaseController{
	public function model(){
		$result = Demo::find(2);
		var_dump($result);
	}

	public function model2(){
		$modelObj = new Demo();
		$results = $modelObj->where("category_id",3)
			->limit(2)
			->order("id","desc")
			->select();

			//print_r($result);
			foreach($results as $result){
				//print_r($result->content);
				dump($result->status);
			}
	}
}